//
//  BtUtils.h
//  BaiduTravel
//
//  Copyright 2011年 Neusoft. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BTDefines.h"

@class UIViewController; 
@class BTHTTPRequest;

typedef enum
{
    StringObjectImage,
    StringObjectText
}EStringObjectType;

@interface StringObject : NSObject
{
    NSString            *_value;
    EStringObjectType   _type;
}
@property (nonatomic, retain)   NSString            *value;
@property (nonatomic)           EStringObjectType   type;
-(CGSize) sizeWithFont:(UIFont*)font;

@end

@interface NSString (MyExtensions)

- (NSString *) md5;

- (CGSize)customSizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size; // Uses UILineBreakModeWordWrap
- (CGSize)customDrawInRect:(CGRect)rect withFont:(UIFont *)font;
- (CGSize)customDrawInRect:(CGRect)rect withFont:(UIFont *)font lineBreakMode:(UILineBreakMode)lineBreakMode; // Uses UITextAlignmentLeft
@end

@interface NSData (MyExtensions)

- (NSString*)md5;

@end

@interface BtUtils : NSObject {
    
}

+ (NSString*) substringWithMaxThirtyChars:(NSString*)str;

+ (NSString*) substringWithMaxChars:(NSString*)str
                           maxChars:(int)aMaxChars;

+ (int)calculateContentHeight:(NSString*)aText
                 contentWidth:(int)aContentWidth
             maxContentHeight:(int)aMaxContentHeight
                     maxChars:(int)aMaxChars
                     fontSize:(int)aFontSize;


+ (NSString*)getFormattedStartTime:(NSDate*)aDate;
+ (NSString*)getDetailFormattedCreateTime:(NSDate*)aDate;
+ (NSString*)getShortFormattedCreateTime:(NSDate*)aDate;
+(NSString*)getYearAndMonthFormattedCreateTime:(NSDate*)aDate;
+ (UIImage*)getTalkFrameImage:(int)height;
+ (UIImage*)getNoteTalkFrameImage:(int)height;


+ (NSArray*) buildStringObjectArray:(NSString*)string;
+ (NSString*)getRemarkScoreFace:(NSInteger)score;
+ (NSString*)getRemarkScoreText:(NSInteger)score;
@end
